package com.mrkun.vueshop.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mrkun.vueshop.mapper.FundMapper;
import com.mrkun.vueshop.model.Fund;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.List;

/**
 * @author by yong
 * @date 2020/3/18
 */
@Service
public class FundService {
    @Autowired
    private FundMapper fundMapper;

    public PageInfo<Fund> getFunds(Integer page,Integer size,String query){
        PageHelper.startPage(page,size);
        List<Fund> fundList = fundMapper.findAll(query);
        PageInfo<Fund> fundPage = new PageInfo<>(fundList);
        return fundPage;
    }
}
